package Level02_nine;

import java.util.Arrays;
import java.util.HashSet;

public class Test {
    public static void main(String[] args) {
        Student student = new Student("小胡", 22, 100);
        Student student1 = new Student("小胡", 22, 99);
        Student student2 = new Student("小程", 21, 98);
        Student student3 = new Student("小向", 20, 97);
        Student student4 = new Student("小植", 19, 96);
        Student[] arry = {student, student1, student2, student3, student4};
        HashSet<Object> hashSet = new HashSet<>();
        hashSet.addAll(Arrays.asList(arry));
        double max = Double.MIN_VALUE;
        double min = Double.MAX_VALUE;
        double total = 0;
        double count = 0;
        for (Object o : hashSet) {
            Student student5 = (Student) o;
            total += student5.getScore();
            if (student5.getScore() > max) {
                max = student5.getScore();
            }
            if (student5.getScore() < min) {
                min = student5.getScore();
            }
        }
        System.out.println("最高分：" + max);
        System.out.println("最低分：" + min);
        System.out.println("平均分：" + total / hashSet.size());
    }
}
